package com.feature.core.listener;

import org.springframework.boot.context.event.ApplicationStartingEvent;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.event.GenericApplicationListener;
import org.springframework.core.ResolvableType;

import com.alibaba.fastjson2.JSON;

public class ApplicationStartEventListener implements GenericApplicationListener {

	@Override
	public void onApplicationEvent(ApplicationEvent event) {
		JSON.configWriterDateFormat("yyyy-MM-dd HH:mm:ss");
	}

	@Override
	public boolean supportsEventType(ResolvableType eventType) {
		return ApplicationStartingEvent.class.isAssignableFrom(eventType.getRawClass());
	}

}
